//
//  GPHeader.h
//  gupiao
//
//  Created by mac on 2019/8/14.
//  Copyright © 2019 mac. All rights reserved.
//

#ifndef GPHeader_h
#define GPHeader_h

#import "CCPNetworking.h"
#import "UIView+Extension.h"
#import "HMTableView.h"
#import "MJExtension.h"
#import <IQKeyboardManager.h>
#import "MBProgressHUD+ADD.h"
#import "HMSafeAreaFit.h"
#import "UITableViewCell+HMCreatTableViewCell.h"
#import "UIScrollView+Refresh.h"
#import <MJRefresh.h>

#ifdef DEBUG
#define debugLog(...)    NSLog(__VA_ARGS__)
#else
#define debugLog(...)
#endif

//创建弱引用对象
#define WeakObj(o) @autoreleasepool{} __weak typeof(o) o##Weak = o
//屏幕宽高
#define SCREEN_WIDTH [UIScreen mainScreen].bounds.size.width
#define SCREEN_HEIGHT [UIScreen mainScreen].bounds.size.height
//屏幕适配
#define FC_AUTO SCREEN_WIDTH / 375.0
//#define FC_NAVHEIGHT [UIScreen mainScreen].bounds.size.height == 812 ? 88.0 : 64.0  // 导航栏高度
//#define FC_TABBARHEIGHT [UIScreen mainScreen].bounds.size.height == 812 ? 83.0 : 49.0  // TabBar高度
//#define IPHONEX [UIScreen mainScreen].bounds.size.height == 812 ? YES: NO // 判断是否是iPhone X
//颜色
#define UIColorFromRGB(rgbValue) [UIColor colorWithRed:((float)((rgbValue & 0xFF0000) >> 16))/255.0f green:((float)((rgbValue & 0xFF00) >> 8))/255.0f blue:((float)(rgbValue & 0xFF))/255.0f alpha:1.0]
#define TEST_COLOR [UIColor colorWithRed:rand()%255/255.0 green:rand()%255/255.0 blue:rand()%255/255.0 alpha:1]
#define DEFAULT_THEMECOLOR [UIColor colorWithRed:255/255.0 green:78/255.0 blue:19/255.0 alpha:1] // 主题色

// 字体
#define DEFAULT_FONT(s) [UIFont systemFontOfSize:s]
#define DEFAULT_MEDIUMFONT(s) [UIFont fontWithName:@"PingFang-SC-Medium" size:s]
#define DEFAULT_BOLDFONT(s) [UIFont boldSystemFontOfSize:s]
//应用窗口
#define WINDOW [UIApplication sharedApplication].delegate.window
#define APPLICATION_DELEGATE ((AppDelegate *)[[UIApplication sharedApplication] delegate])

#define VALID_STRING(_str) ([_str isKindOfClass:[NSString class]]?_str:@"")
#define VALID_ARRAY(_arr) ([_arr isKindOfClass:[NSArray class]]?_arr:[NSArray array])


#define USER_DEFAULTS [NSUserDefaults standardUserDefaults]

#define NOTI_NETWORK_WWAN @"notice_network_4g" // 网络变化为4g通知
#define NOTI_NETWORK_WWAN_ALERT @"notice_network_4g_alert" // 网络变化为4g通知显示alert

#define REIVED_NOTIFICATION @"REIVED_NOTIFICATION"//接收到通知消息

#define HUD_TIME 2

#define SUCCESS_CODE 10000

#define SEARCH_HISROTY_KEY @"searchHistory"

#endif /* GPHeader_h */
